package com.lucanjun.cn.springboot.business.controller;

import com.lucanjun.cn.springboot.business.model.entity.User;
import com.lucanjun.cn.springboot.business.service.UserService;
import com.lucanjun.cn.springboot.common.result.HttpResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author lucanjun
 * @version 1.0.0
 * @title UserController
 * @create 2024-12-19 17:45:58
 * @description 用户模块
 */
@Slf4j
@RestController
@Tag(name = "用户模块")
@RequiredArgsConstructor
@RequestMapping("/api/user")
public class UserController {

    private final UserService userService;

    @PostMapping("/findAll")
    @Operation(summary = "查询全部用户接口", description = "查询全部用户接口")
    public HttpResult<List<User>> findAll() {
        List<User> userList = userService.list();
        return HttpResult.returnSuccess(userList);
    }

}
